package com.yh.mybatis.reflection;

import com.yh.mybatis.reflection.factory.DefaultObjectFactory;
import com.yh.mybatis.reflection.factory.ObjectFactory;
import com.yh.mybatis.reflection.wrapper.DefaultObjectWrapperFactory;
import com.yh.mybatis.reflection.wrapper.ObjectWrapperFactory;

/**
 * 系统元对象
 *
 * @author yh
 * @date 2023/09/28
 */
public class SystemMetaObject {
    public static final ObjectFactory DEFAULT_OBJECT_FACTORY = new DefaultObjectFactory();

    public static final ObjectWrapperFactory DEFAULT_OBJECT_WRAPPER_FACTORY = new DefaultObjectWrapperFactory();
    public static final MetaObject NULL_META_OBJECT = MetaObject.forObject(NullObject.class,DEFAULT_OBJECT_FACTORY,DEFAULT_OBJECT_WRAPPER_FACTORY);

    public SystemMetaObject() {
    }


    /**
     * 空对象
     *
     * @author yh
     * @date 2023/09/28
     */
    private static class NullObject{

    }

    public static  MetaObject forObject(Object object){
        return MetaObject.forObject(object, DEFAULT_OBJECT_FACTORY, DEFAULT_OBJECT_WRAPPER_FACTORY);
    }
}
